using System.Collections.Generic;

namespace CurrencyConv.Core.SettingsManager
{
	public class CCSettings
	{
		public string RemoteSiteAddress { get; set; }
		public string SavedExchangeRatesPath { get; set; }

		public static CCSettings Default
		{
			get
			{
				return new CCSettings
				       	{
									RemoteSiteAddress = "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml",
				       		SavedExchangeRatesPath = "exchangeRates.txt"
				       	};
			}
		}

		public static IList<string> PropertyNames = new List<string> { "RemoteSiteAddress", "SavedExchangeRatesPath" };

		public override bool Equals(object obj)
		{
			if (ReferenceEquals(null, obj)) return false;
			if (ReferenceEquals(this, obj)) return true;
			if (obj.GetType() != typeof(CCSettings)) return false;
			return Equals((CCSettings)obj);
		}

		public bool Equals(CCSettings other)
		{
			if (ReferenceEquals(null, other)) return false;
			if (ReferenceEquals(this, other)) return true;
			return Equals(other.RemoteSiteAddress, RemoteSiteAddress) && Equals(other.SavedExchangeRatesPath, SavedExchangeRatesPath);
		}

		public override int GetHashCode()
		{
			unchecked
			{
				return ((RemoteSiteAddress != null ? RemoteSiteAddress.GetHashCode() : 0)*397) ^ (SavedExchangeRatesPath != null ? SavedExchangeRatesPath.GetHashCode() : 0);
			}
		}
	}
}